<?php
/**
 * @file test007.php
 * @package taobaoke
 * @subpackage 
 * @version $id: 0.1 UTF-8 2009-7-7 下午04:56:45 $
 * @author LD King (mifunny.info)
 * @copyright Copyright (c) 2007 - 2009 MiFunny China Inc. (http://mifunny.info)
 * 获取SessionKey的容器地址：http://container.open.taobao.com/container?appkey=12001409 
 * 测试数据获取完整性！ 
 * 
 * 
 * 仍需测试数据：iid(1) - f70d7b54702fd3f52134511c0f0c97ae
title(1) - 【5151m 09夏】CK 莱卡专柜同步亮印花弹性修身V领短袖T恤 195黑
pic_url(1) - http://img04.taobaocdn.com/bao/uploaded/i4/T1P60fXlGMVJMxbDkS_010225.jpg
price(1) - 48.00
click_url(1) - http://s.click.alimama.com/ma_a?e=7TbRJUSXBju0lL7I6pV5qrpP0pRornpBv6vsB1g1OvQA6tF%2FDfW%2Bnq70fym2WVDpYtUJ%2FVl%2B6yJjCDAdwhOKH82mDfjQ1KVVbTMMwFZeLucWDYsSXGIB8qXBgfwjwgYvXMjHKT5tCuSzPCpx%2BB1AN0mqqfhaohXXmsDQg5adEjxYyNLfV1%2F%2BMmPtOlm2p3AQvsRqQlsYGLO%2Ba6XMsF9LxzQuRO8lVV4%3D&c=970acb9b3929c0d99ed8da429ec4d5ae
nick(1) - 君伟服饰
 * 
 * 
 */

header("Content-Type:text/html;charset=UTF-8");
require_once '../lib/itemGet.php';

/*$params = array(  
       'method' => 'taobao.user.get', 
       'session'=> trim($_GET['top_session']), // 主要是添加这一句 
       'fields' => 'user_id,sex,nick,type,created', 
       'nick' => '优衣库官方旗舰店' 
); */


///////////////////////////////////////////////////单件商品信息
// 获取淘宝客商品
/*$params = array(  
       'method' => 'taobao.taobaoke.items.get',
       'session'=> trim($_GET['top_session']), // 主要是添加这一句 
'fields' => 'iid,title,nick,pic_url,price,click_url,
	commission,commission_rate,commission_num,commission_volume',
	'pid' => 'mm_11536991_0_0',
	'cid' => 1512,
	'page_size' => 1,
	'credit' => '1crown',
);*/

// ["iid"]=>  string(32) "939723b67cc9f906098e10ce4c022bb9 ["nick"]=>  string(16) "bawffgai19840929" 
/*$params = array(  
       'method' => 'taobao.item.get',
       'session'=> trim($_GET['top_session']), // 主要是添加这一句 
'fields' => 'iid,title,cid,nick,location,sku.sku_id,sku.properties',
		'iid' => '939723b67cc9f906098e10ce4c022bb9',
	'nick' => 'bawffgai19840929'
);*/
// (获取SKU) ["sku_id"]=>  string(8) "58848011" } 
/*$params = array(  
       'method' => 'taobao.item.sku.get',
       'session'=> trim($_GET['top_session']), // 主要是添加这一句 
'fields' => 'sku_id,iid	String,properties,quantity,price,outer_id,created,modified,status',
		'sku_id' => '58848011',
	'nick' => 'bawffgai19840929'
);*/
// (获取标准类目属性值) ["cid"]=>  string(4) "1512" ["properties"]=>  string(29) "1627207:28341;1630696:3266779"
/*$params = array(  
       'method' => 'taobao.itempropvalues.get',
       'session'=> trim($_GET['top_session']), // 主要是添加这一句 
'fields' => 'cid,pid,prop_name,vid,name,name_alias,is_parent,status,sort_order',
		'cid' => '1512',
	'pvs' => '1627207:28341;1630696:3266779'
);*/


////////////////////////////////////////所有分类
/*$params = array(  
       'method' => 'taobao.itemcats.get.v2',
       'session'=> trim($_GET['top_session']), // 主要是添加这一句 
'fields' => 'cid,parent_cid,name,is_parent,status,sort_order',
		'parent_cid' => '0',
);
*/

//**************************************8 测试用户 ["nick"]=>  string(9) "蔚蓝印"
/*$params = array(  
       'method' => 'taobao.user.get',
       'session'=> trim($_GET['top_session']), // 主要是添加这一句 
'fields' => 'user_id,nick,sex,seller_credit,created',
	'nick' => '蔚蓝印'
);*/
/*$params = array(  
       'method' => 'taobao.shop.get',
       'session'=> trim($_GET['top_session']), // 主要是添加这一句 
'fields' => 'sid,cid,nick,title,desc,created ',
	'nick' => '蔚蓝印'
);*/
$params = array(  
       'method' => 'taobao.taobaoke.shops.convert',
       'session'=> trim($_GET['top_session']), // 主要是添加这一句 
'fields' => 'user_id,shop_title,click_url,shop_commission.rate',
'sids' => '33413905',
	'nick' => 'kldoo'
);


////////////////////////////////////////店铺  ["nick"]=>  string(21) "福运来通讯数码" 
/*$params = array(  
       'method' => 'taobao.user.get',
       'session'=> trim($_GET['top_session']), // 主要是添加这一句 
'fields' => 'user_id,nick,sex,seller_credit,created',
	'nick' => '福运来通讯数码'
);*/
// 卖家商铺
/*$params = array(  
       'method' => 'taobao.shop.get',
       'session'=> trim($_GET['top_session']), // 主要是添加这一句 
'fields' => 'sid,cid,nick,title,desc,created ',
	'nick' => '福运来通讯数码'
);*/
// 淘宝客商铺推广URL ["sid"]=>  string(8) "57233189"
/*$params = array(  
       'method' => 'taobao.taobaoke.shops.convert',
       'session'=> trim($_GET['top_session']), // 主要是添加这一句 
'fields' => 'user_id,shop_title,click_url,shop_commission.rate',
'sids' => '57233189',
	'nick' => 'kldoo'
);*/


////////////////////////////////////////商品评价
/*$params = array(  
       'method' => 'taobao.traderates.get',
       'session'=> trim($_GET['top_session']), // 主要是添加这一句 
'fields' => 'totalResults,tid,order_id,role,nick,result,created,rated_nick,item_title,item_price,content,reply',
		'rate_type' => 'get',
	'role' => 'buyer'
);*/


$ig = new itemGet($params);
$result = $ig->getResult();
$result = $result['taobaokeShop'];
echo '<br />click_url => '.$result['click_url'];
echo '<br />shop_commission.rate => '.$result['shop_commission.rate'];
/*$result = $result['shop'];
echo '<br />sid => '.$result['sid'];
echo '<br />title => '.$result['title'];
echo '<br />desc => '.strip_tags($result['desc']);
echo '<br />created => '.$result['created'];*/
/*$result = $result['user'];
echo '<br />user_id => '.$result['user_id'];
echo '<br />nick => '.$result['nick'];
echo '<br />seller_credit => '.$result['seller_credit']['level'];
echo '<br />sex => '.$result['sex'];
echo count($result);*/
var_dump($result);
?>